package dabs.engine;

public class ComponentPart implements Updatable{
	private HydraulicState oldHydroState;
	private HydraulicState newHydroState;
	private int health;
	private String name;
	//Maybe time is not necessary for all components.
	private int time;
	
	private PowerPlant plant;
	
	public ComponentPart(PowerPlant plant, String name) {
		this.plant = plant;
		health = 100;
		this.name = name;
		time = 0;
	}
	
	public HydraulicState getOldHydroState() { return oldHydroState; }
	public HydraulicState getNewHydroState() { return newHydroState; }
	public int getHealth() { return health; }
	public void setHealth(int health) { this.health = health; }
	public String getName() { return name; }
	public void setTime(int time) {this.time = time; }
	public int getTime() { return time; }
	
	public void passMessage(Notification notif){
		plant.poffice.handleNotification(notif);
	}
	
	//Maybe not necessary?
	public void tick(){
		time++;
	}
}
